package com.zigong.app.beans;

import android.support.annotation.NonNull;

import com.ruihang.generalibrary.utils.IShares;
import com.ruihang.generalibrary.utils.UrlUtils;
import com.zigong.app.application.Constances;

import java.io.Serializable;
import java.util.List;

/**
 * Created by liuyu on 2017/8/9.
 */

public class FNews extends NewsItem implements Serializable, IShares {
    private static final long serialVersionUID = 2851079194994216420L;

    /**
     * 新闻作者
     */
    private String authorName;
    /**
     * 当前新闻评论总数
     */
    private int commentCount;
    /**
     * 新闻详情图片数组
     */
    private List<ImageInfo> images;
    /**
     * 新闻正文H5
     */
    private String newsContentH5;

    /**
     * 新闻分享url
     */
    private String newsSharedUrl;
    /**
     * 新闻来源
     */
    private String newsSource;
    /**
     * 相关新闻列表
     */
    private List<NewsItem> relateNewsList;

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public List<ImageInfo> getImages() {
        return images;
    }

    public void setImages(List<ImageInfo> images) {
        this.images = images;
    }

    public String getNewsContentH5() {
        return newsContentH5;
    }

    public void setNewsContentH5(String newsContentH5) {
        this.newsContentH5 = newsContentH5;
    }

    public String getNewsShareUrl() {
        return newsSharedUrl;
    }

    public void setNewsShareUrl(String newsShareUrl) {
        this.newsSharedUrl = newsShareUrl;
    }

    public String getNewsSource() {
        return newsSource;
    }

    public void setNewsSource(String newsSource) {
        this.newsSource = newsSource;
    }

    public List<NewsItem> getRelateNewsList() {
        return relateNewsList;
    }

    public void setRelateNewsList(List<NewsItem> relateNewsList) {
        this.relateNewsList = relateNewsList;
    }

    @NonNull
    @Override
    protected String getToStringHead() {
        return "NewsItem{";
    }

    @NonNull
    @Override
    protected String getChildToString() {
        return "\n         authorName='" + authorName + '\'' +
                ", commentCount=" + commentCount +
                ", images=" + images +
                ", newsContentH5='" + newsContentH5 + '\'' +
                ", newsMediaUrl='" + newsMediaUrl + '\'' +
                ", newsShareUrl='" + newsSharedUrl + '\'' +
                ", newsSource='" + newsSource + '\''+
                ", relateNewsList='" + relateNewsList ;
    }

    @Override
    public String toString() {
        return "FNews{" +
                "authorName='" + authorName + '\'' +
                ", commentCount=" + commentCount +
                ", images=" + images +
                ", newsContentH5='" + newsContentH5 + '\'' +
                ", newsMediaUrl='" + newsMediaUrl + '\'' +
                ", newsShareUrl='" + newsSharedUrl + '\'' +
                ", newsSource='" + newsSource + '\'' +
                '}';
    }

    @Override
    public String getShareTitle() {
        return newsTitle;
    }

    @Override
    public String getShareH5() {
        return newsContentH5;
    }

    @Override
    public String getShareImage() {
        return newsImage;
    }

    @Override
    public String getShareDigest() {
        return newsSource;
    }

    @Override
    public String getShareURL() {
        return UrlUtils.linkUrls(Constances.ST_BASE_URL,newsSharedUrl) ;
    }
}
